package com.dq.repository.address;

import com.dq.domain.address.Address;
import com.dq.domain.org.Org;
import com.dq.domain.sys.user.user.base.SysUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author liuhui
 * @date 2019/9/17 0017 20:06:35
 */
@Repository
public interface AddressRepository extends JpaRepository<Address, Long> {
    List<Address> findByUserAndDeletedFalse(SysUser user);

    Address getByUserAndIsDefaultTrue(SysUser user);

    List<Address> findByOrg(Org org);

    List<Address> findByUserAndDeletedFalseAndIsDefaultTrue(SysUser user);
}
